import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

//写数据（字符流）
public class Demo_9 {
    public static void main(String[] args) {
        //普通写
//        try(Writer writer = new FileWriter("./AAA.txt")){
//            String s = "节日快乐";
//            writer.write(s);
//        } catch (IOException e) {
//            throw new RuntimeException(e);
//        }

        //追加写
        try(Writer writer1 = new FileWriter("./AAA.txt",true)){
            String s = "节日快乐";
            writer1.write(s);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
